package db_sports

import (
	"longmen/server/pkg/db/mysql"
	"longmen/server/pkg/db/mysql/models/models_sports"
)

// for qq sports db logo
func BasketballTeam(name string) (*models_sports.BasketballTeam, error) {
	team := &models_sports.BasketballTeam{}
	err := mysql.GetSportsTable(&models_sports.BasketballTeam{}).Where("name_zh=? or short_name_zh=?", name, name).Find(&team).Error
	return team, err
}

func FootballTeam(name string) (*models_sports.FootballTeam, error) {
	team := &models_sports.FootballTeam{}
	err := mysql.GetSportsTable(&models_sports.FootballTeam{}).Where("name_zh=? or short_name_zh=?", name, name).Find(&team).Error
	return team, err
}
